<template>
  <div class="hello">
    <!-- header -->
      <mt-header fixed title="首页" id="header"></mt-header>
      <!--图片 -->
      <div id="image">
          <img src="../assets/image/logo.jpg" alt="">
      </div>
      <!-- 数据  title   修改密码  消息通知-->
      <div class="data">
          <h4 class="dataTitle">数据明细</h4>
          <div class="txt">
              <span class="message" @click="getMessage">
                <img src="../assets/image/message.png" alt="">
              </span>
              <span class="password" @click="getPassword">
                <img src="../assets/image/password.png" alt="">
              </span>
          </div>
      </div>
      <!-- 当前雷达运行情况 -->
      <div class="radar_info">
          <p>当前雷达运行情况</p>
          <div class="radar_table">
              <el-table :data="tableData" border :row-key="getRowKeys" :expand-row-keys="expands"  max-height="300" id="table">
                  <el-table-column type="expand" width="30" >
                    <template>
                      <el-table :data="tableList" border id="tableList">
                        <el-table-column type="expand" width="30">
                            <template>
                              <el-table :data="zhanjiangList" border id="zhanjiang">
                                  <el-table-column label="" prop="name" width="120"></el-table-column>
                                  <el-table-column label="" prop="state" width="50"></el-table-column>
                                  <el-table-column label="" prop="report"></el-table-column>
                              </el-table>
                            </template>
                        </el-table-column>
                        <el-table-column label="" prop="name"></el-table-column>
                        <el-table-column label="" prop="state" width="60"></el-table-column>
                        <el-table-column label="" prop="report"></el-table-column>
                      </el-table>
                    </template>
                  </el-table-column>
                  <!-- table header -->
                  <el-table-column label="站点名称" prop="name"></el-table-column>
                  <el-table-column label="设备状态" prop="state"></el-table-column>
                  <el-table-column label="工作报告" prop="report"></el-table-column>
              </el-table>
          </div>
      </div>
      <!-- 通知公告 -->
      <div class="announce">
          <p>通知公告</p>
          <div class="content">
              <div class="contentTitle">2017VTS评估会</div>
              <div class="content_c" :class="{active:isActive}">2017VTS评估会2017VTS,评估会2017VTS评估会2017VTS,评估会2017VTS评估会2017VTS,评估会2017VTS评估会2017VTS评估会。2017VTS评估会2017VTS评估会</div>
              <div class="clickTxt" @click="clickTxt">点开全文</div>
          </div>
      </div>
      <!-- 任务清单列表 -->
      <div class="task">
        <p>任务清单列表</p>
        <el-collapse>
          <el-collapse-item title="汕头广澳大山UPS应急维修---2018-03-28" name="1">
            <div>任务类型:维修</div>
            <div class="act">实施对象:山特UPS</div>
            <div>海事局:汕头海事局</div>
            <div>雷达站:广澳大山</div>
            <div class="act">任务内容:检修山特UPS</div>
            <div>任务来源:山特UPS</div>
            <div>实施对象:工程师巡检</div>
            <div>任务状态:已完成</div>
            <div>审核状态:项目经理已审批</div>
            <div>工作量(天):3</div>
            <div>计划实施时间:2018-03-28</div>
          </el-collapse-item>
          <el-collapse-item title="汕头广澳大山UPS应急维修---2018-03-28" name="2">
            <div>控制反馈：通过界面样式和交互动效让用户可以清晰的感知自己的操作；</div>
            <div>页面反馈：操作后，通过页面元素的变化清晰地展现当前状态。</div>
          </el-collapse-item>
          <el-collapse-item title="汕头广澳大山UPS应急维修---2018-03-28" name="3">
            <div>简化流程：设计简洁直观的操作流程；</div>
            <div>清晰明确：语言表达清晰且表意明确，让用户快速理解进而作出决策；</div>
            <div>帮助用户识别：界面简单直白，让用户快速识别而非回忆，减少用户记忆负担。</div>
          </el-collapse-item>
          <el-collapse-item title="汕头广澳大山UPS应急维修---2018-03-28" name="4">
            <div>用户决策：根据场景可给予用户操作建议或安全提示，但不能代替用户进行决策；</div>
            <div>结果可控：用户可以自由的进行操作，包括撤销、回退和终止当前操作等。</div>
          </el-collapse-item>
        </el-collapse>
      </div>
      <!--任务实施列表  -->
      <div class="task">
          <p>任务实施列表</p>
          <el-collapse>
          <el-collapse-item title="惠州海事局" name="1">
            <div>雷达站:惠州VTS中心</div>
            <div>任务状态:实施中</div>
            <div>审核状态:待审核</div>
            <div>任务系列号:20180622005</div>
          </el-collapse-item>
          <el-collapse-item title="汕头广澳大山UPS应急维修" name="2">
            <div>雷达站:惠州VTS中心</div>
            <div>任务状态:实施中</div>
            <div>审核状态:待审核</div>
            <div>任务系列号:20180622005</div>
          </el-collapse-item>
          <el-collapse-item title="汕头广澳大山UPS应急维修" name="3">
            <div>雷达站:惠州VTS中心</div>
            <div>任务状态:实施中</div>
            <div>审核状态:待审核</div>
            <div>任务系列号:20180622005</div>
          </el-collapse-item>
          <el-collapse-item title="汕头广澳大山UPS应急维修" name="4">
            <div>雷达站:惠州VTS中心</div>
            <div>任务状态:实施中</div>
            <div>审核状态:待审核</div>
            <div>任务系列号:20180622005</div>
          </el-collapse-item>
        </el-collapse>
      </div>
  </div>
</template>

<script>
export default {
  data(){
    return{
      checked: 'workList',
      activeName: 'second',
      isActive:true,
    //默认选中第一项
      selected:"index",
      tableData:[
          {
            name:"广东省",
            state:"正常",
            report:"-"
          }
      ],
    tableList:[
        {
          name:"湛江海事局",
          state:"正常",
          report:"暂无"
        },
       {
          name:"茂名海事局",
          state:"正常",
          report:"暂无"
        },
        {
          name:"惠州海事局",
          state:"正常",
          report:"暂无"
        },
        {
          name:"珠海海事局",
          state:"正常",
          report:"暂无"
        },
        {
          name:"东莞海事局",
          state:"正常",
          report:"暂无"
        }
    ],
    zhanjiangList:[
        {
          name:"海湾大桥雷达站",
          state:"正常",
          report:"巡检报告"
        },
        {
          name:"洲岛雷达站",
          state:"正常",
          report:"巡检报告"
        },
        {
          name:"山狗吼雷达站",
          state:"正常",
          report:"巡检报告"
        },
        {
          name:"三塘角雷达站",
          state:"正常",
          report:"巡检报告"
        }
    ],
    // 获取row的key值
    getRowKeys(row) {
      return row.id;
    },
    // 要展开的行，数值的元素是row的key值
    expands: [],
    form: {
      name: '',
      region: '',
      date1: '',
      date2: '',
      delivery: false,
      type: [],
      resource: '',
      desc: ''
    },
    query1:'all',
    query2:'all',
    query3:'all',
    query4:'all',
    query5:'all'

    }
  },
  mounted() {
    // 在这里你想初始化的时候展开哪一行都可以了
    this.expands.push(this.tableList[1].id);
  },
  methods:{
    clickTxt(){
      this.isActive = !this.isActive;
      var clickTxt = document.getElementsByClassName("clickTxt")[0];
      if(this.isActive){
         clickTxt.innerHTML="点开全文"
      }else{
         clickTxt.innerHTML="收起"
      }
    },
    handleToggleDrawer() {
      this.$refs.drawerLayout.toggle();
    },
    toIndex(){
      this.$router.push('/index');
    },
    // 消息通知
    getMessage(){
      this.$router.push('/message');
    },
    // 修改密码
    getPassword(){
      this.$router.push('/modifyPassword');
    }
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="scss">
.hello{
    width:100vw;
    overflow: hidden;
    margin-bottom:100px;
}
 #image{
    width:100vw;
    overflow: hidden;
    margin-top:2.5rem;
    img{
      display: block;
      width:100vw;
      height:30vw;
    }
  }
  .data{
    width:100vw;
    height:10vw;
    line-height:10vw;
    .dataTitle{
      width:47vw;
      float:left;
      padding-left:3vw;

    }
    .txt{
      width:50vw;
      float:left;
      .message{
        float:right;
        padding-right:5vw;
      }
      .password{
        float:right;
        padding-right:5vw;
      }
    }
  }
  .radar_info{
    p{
      line-height:10vw;
      padding-left:3vw;
      color:#777676;
    }
    .el-table{
      width:96vw;
      margin:auto;
      #tableList{
        margin-left:49px;
       
        #zhanjiang{
          font-size:12px;
        }
      }
    }
  }
  .announce{
     width:96vw;
     overflow: hidden;
     margin:auto;
     p{
      margin-top:5vw;
      line-height:10vw;
      padding-left:3vw;
      color:#777676;
    }
    .content{
      width:100%;
      padding-left:3vw;
      .contentTitle{
        line-height:30px;
        color:#333;
      }
      .content_c{
        width:90vw;
        line-height:1.5rem;
        font-size:0.8rem;
        color:#333;
       text-indent:16px;
       text-align: justify;  
      }
    }
    .clickTxt{
      margin-top:2vw;
      font-size:0.8rem;
      color:darkred;
    }
  }
  .task{ 
    width:90vw;
    margin:auto;
     p{
      margin-top:5vw;
      line-height:10vw;
      color:#777676;
    
    }
    .act{
      color:darkred;
    }
  }
  .tab{
    margin-top:40px;
  }
  .dangan{
    width:100vw;
    height:40px;
    line-height:40px;
    padding-left:5vw;
    margin-top:40px;
    color:#1b3464;
    font-weight:700;
  }
  #renwu{
    width:90vw;
    margin:auto;
  }
// 点开全文
.active{
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}
</style>
